package cn.yunyichina.provider.pay.alipay.main;

import cn.yunyichina.provider.framework.data.SpringContextHandler;
import cn.yunyichina.provider.framework.dubbo.service.impl.YytServiceImpl;
import cn.yunyichina.provider.iface.entity.alipay.*;
import cn.yunyichina.provider.iface.entity.common.ResCommon;
import cn.yunyichina.provider.iface.entity.dto.pay.*;
import cn.yunyichina.provider.iface.entity.pay.alipay.MedicareResponse;
import cn.yunyichina.provider.iface.entity.pay.alipay.MedicareVo;
import cn.yunyichina.provider.iface.service.IAlipay;
import cn.yunyichina.provider.message.alipay.service.AlipayCardMessageService;
import cn.yunyichina.provider.pay.alipay.service.AlipassService;
import cn.yunyichina.provider.pay.alipay.service.AlipayBillService;
import cn.yunyichina.provider.pay.alipay.service.AlipayTradeService;
import cn.yunyichina.provider.pay.alipay.service.impl.AlipayMedicareServiceImpl;

public class AlipayServiceImpl extends YytServiceImpl implements IAlipay {

    public String getErrorCode() {
        return "11000";
    }

    public ResCommon<MedicareResponse> queryAlipayFacepayMedicare(MedicareVo medicareVo) throws Exception {
        return ((AlipayMedicareServiceImpl) SpringContextHandler.getBean("alipayMedicareServiceImpl")).queryAlipayFacepayMedicare(medicareVo);
    }

    public ResCommon<AlipayFacepayMedicalCardQueryResponse> queryAlipayFacepayMedicare(AlipayFacepayMedicalCardQueryRequest queryRequest) throws Exception {
        return ((AlipayMedicareServiceImpl) SpringContextHandler.getBean("alipayMedicareServiceImpl")).queryAlipayFacepayMedicare(queryRequest);
    }

    public ResCommon<Object> queryAlipayWebpayMedicare(AlipayWebpayMedicalCardQueryRequest queryRequest) throws Exception {
        return ((AlipayMedicareServiceImpl) SpringContextHandler.getBean("alipayMedicareServiceImpl")).queryAlipayWebpayMedicare(queryRequest);
    }

    public AddAlipayCouponResponse addAlipayCouponInstance(AlipayRequest alipayRequest) {
        return SpringContextHandler.getBean(AlipassService.class).addAlipassInstance(alipayRequest);
    }

    public ResCommon<AlipayBarPayResponseDTO> alipayBarPay(AlipayBarPayRequestDTO requestDTO) {
        return SpringContextHandler.getBean(AlipayTradeService.class).alipayBarPay(requestDTO);
    }

    public ResCommon<AlipayOrderQueryResponseDTO> queryAlipayOrder(AlipayOrderQueryRequestDTO queryRequest) {
        return SpringContextHandler.getBean(AlipayTradeService.class).queryAlipayOrder(queryRequest);
    }

    public ResCommon<AlipayOrderCancelResponseDTO> cancelAlipayOrder(AlipayOrderCancelRequestDTO cancelRequest) {
        return SpringContextHandler.getBean(AlipayTradeService.class).cancelAlipayOrder(cancelRequest);
    }

    public ResCommon<AlipayBillDownloadResponseDTO> downloadAlipayBill(AlipayBillDownloadRequestDTO downloadRequest) {
        return SpringContextHandler.getBean(AlipayBillService.class).downloadAlipayBill(downloadRequest);
    }

    public ResCommon<AlipayResponse> sendCardMessage(AlipayRequest alipayRequest) {
        return SpringContextHandler.getBean(AlipayCardMessageService.class).sendCardMessage(alipayRequest);
    }

    @Override
    public ResCommon<AlipayMedInfoUploadResponseDTO> alipayMedInfoUpload(AlipayRequest alipayRequest) {
        return SpringContextHandler.getBean(AlipayTradeService.class).alipayMedInfoUpload(alipayRequest);
    }

}
